package xc.com.oss.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

@Configuration
public class OssConfig {
//    @Value(value = "${oss.access-key}")
//    public static String accessKey;
//    @Value("${oss.secret-key}")
//    public static String secretKey;
//    @Value("${oss.endpoint}")
//    public static String endpoint;

    private static String accessKey="LTAI5tCzkyzCFLDZFdLySi77";
    private static String secretKey="KfTQS3fROk8zlSHypCZoUGlGq4wIqW";
    private static String endpoint="oss-cn-shenzhen.aliyuncs.com";

    @Bean
    public OSS getOSS(){
        return new OSSClientBuilder().build(endpoint,accessKey,secretKey);
    }
    @Bean
    public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
        return new PropertySourcesPlaceholderConfigurer();
    }
}
